package com.lovo.controller;

import com.lovo.service.IStudentService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class IndexController {
    @Resource
    private IStudentService studentService;
    @GetMapping("/index")
    public String index(Model model){
        List list = studentService.selectAll();
        model.addAttribute("name","张三");
        model.addAttribute("students",list);
        return "index.html";
    }
}
